package model.Actions;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import view.ViewFunctions;
import DB.Connection.DBConnectionManager;

import commons.Entities.Comment;

public class importCharacterCommentsAction implements Runnable {

	private static final Log logger = LogFactory.getLog(importCharacterCommentsAction.class);

	private Integer characterID;

	public importCharacterCommentsAction(Integer characterID) {
		this.characterID = characterID;
	}

	@Override
	public void run() {
		logger.info("importCharacterCommentsAction starting...");

		List<Comment> comments = DBConnectionManager.get().getCommentsByCharacterID(characterID);
		ViewFunctions.get().updateGUICharacterComments(comments, characterID);

		logger.info("importCharacterCommentsAction ended.");
	}
}
